package com.ror.java.se.map.treemap;

import java.util.TreeMap;

public class Demo02TreeMapStudent {
    public static void main(String[] args) {
        //TreeMap存放"学生-籍贯"键值对
        //年龄大小升序，同岁按名字的字母升序
        TreeMap<Student, String> stuHomeMap = new TreeMap<>();
        stuHomeMap.put(new Student("Zhang San", 23), "河北");
        stuHomeMap.put(new Student("Wang Wu", 25), "上海");
        stuHomeMap.put(new Student("Li Si", 24), "南京");
        stuHomeMap.entrySet().forEach(System.out::println);
    }
}
